<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>Tự đăng tin lên Trẻ Today</title>
    <meta name="description" content="Đăng tin tức lên TreToday.net, đăng tin miễn phí, phóng viên tự do"/>
    <meta name="keywords" content="dang tin, tu dang tin, phong vien"/>
    <?php
    Yii::app()->clientScript->registerCssFile(Yii::app()->BaseUrl . '/css/back/bootstrap.css');
    Yii::app()->clientScript->registerCssFile(Yii::app()->BaseUrl . '/css/back/plugins.css');
    Yii::app()->clientScript->registerCssFile(Yii::app()->BaseUrl . '/css/back/main.css');

    Yii::app()->clientScript->registerCoreScript('jquery');
    Yii::app()->clientScript->registerScriptFile(Yii::app()->BaseUrl . '/kindeditor-4.1.4/kindeditor.js');
    Yii::app()->clientScript->registerScriptFile(Yii::app()->BaseUrl . '/js/tretoday.core.js');
    Yii::app()->clientScript->registerScriptFile(Yii::app()->BaseUrl . '/js/tretoday.web.js');
    Yii::app()->clientScript->registerScriptFile(Yii::app()->BaseUrl . '/js/jquery.blockUI.js');

    ?>
</head>
<body>

<?php $form = $this->beginWidget('CActiveForm', array(
    'id' => 'news-form',
    'enableAjaxValidation' => true,
    'htmlOptions' => array(
        'role' => 'form',
        'class' => 'form-horizontal',
    ),

)); ?>


<div class="alert alert-error" id="divErrors" style="display: none;">
</div>

<div id="divWrapper" class="form admin-main-wrapper">
    <div class="block block-themed block-last">
        <div class="block-title">
            <h4></h4>
        </div>
        <div class="block-content">
            <div class="row control-group">
                <?php echo $form->labelEx($model, 'catalogid', array('class' => 'control-label')); ?>
                <div class="controls">
                    <?php echo $form->dropDownList($model, 'catalogid', CHtml::listData($catalogs, 'id', 'name'), array('id' => 'ddlCatalog')); ?>
                </div>
            </div>

            <div class="row control-group">
                <?php echo $form->labelEx($model, 'title', array('class' => 'control-label')); ?>
                <div class="controls">
                    <?php echo $form->textField($model, 'title', array('size' => 60, 'maxlength' => 255, 'id' => 'txtTitle')); ?>
                </div>
            </div>

            <div class="row control-group">
                <?php echo $form->labelEx($model, 'short', array('class' => 'control-label')); ?>
                <div class="controls">
                    <?php echo $form->textArea($model, 'short', array('id' => 'txtShort', 'row control-groups' => 6, 'cols' => 50)); ?>
                </div>
            </div>

            <div class="row control-group">
                <?php echo $form->labelEx($model, 'content', array('class' => 'control-label')); ?>
                <div class="controls">
                    <?php echo $form->textArea($model, 'content', array('id' => 'txtContent', 'style' => 'width: 100%; height = 300px')); ?>
                </div>
            </div>

            <div class="row control-group">
                <?php echo $form->labelEx($model, 'user', array('class' => 'control-label')); ?>
                <div class="controls">
                    <?php echo $form->textField($model, 'user', array('size' => 60, 'maxlength' => 255, 'id' => 'txtUser')); ?>
                </div>
            </div>

            <div class="row control-group buttons">
                <div class="controls">
                    <?php echo CHtml::button('Đăng tin', array('id' => 'btnSubmit', 'class' => 'btn btn-default')); ?>
                </div>
            </div>
        </div>
    </div>
</div>

<?php $this->endWidget(); ?>
<script type="text/javascript">

    $(document).ready(function () {
        TreToday.baseUrl = '<?php echo Yii::app()->BaseUrl ?>';
        TreToday.Web.NewsPost.init();
    })
</script>
</body>
</html>
